<template>
  <div class="home">
    <el-row :gutter="20">
      <el-col :span="24">
        <el-card class="welcome-card" shadow="hover">
          <template #header>
            <div class="card-header">
              <span>欢迎来到Vue 3 + TypeScript + Element Plus项目</span>
            </div>
          </template>
          <div class="card-content">
            <p>这是一个使用Vue 3、TypeScript和Element Plus构建的现代化应用。</p>
            <el-button type="primary" @click="handleClick">点击我</el-button>
            <el-button type="success">成功按钮</el-button>
            <el-button type="warning">警告按钮</el-button>
            <el-button type="danger">危险按钮</el-button>
          </div>
        </el-card>
      </el-col>
    </el-row>
    
    <el-row :gutter="20" style="margin-top: 20px;">
      <el-col :span="8">
        <el-card shadow="hover">
          <template #header>
            <div class="card-header">
              <span>特性一</span>
            </div>
          </template>
          <div>Vue 3 Composition API</div>
        </el-card>
      </el-col>
      <el-col :span="8">
        <el-card shadow="hover">
          <template #header>
            <div class="card-header">
              <span>特性二</span>
            </div>
          </template>
          <div>TypeScript支持</div>
        </el-card>
      </el-col>
      <el-col :span="8">
        <el-card shadow="hover">
          <template #header>
            <div class="card-header">
              <span>特性三</span>
            </div>
          </template>
          <div>Element Plus组件库</div>
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import { ElMessage } from 'element-plus'

const count = ref(0)
const handleClick = () => {
  count.value++
  ElMessage.success(`按钮点击了 ${count.value} 次`)
}
</script>

<style scoped>
.home {
  padding: 20px;
}

.welcome-card {
  margin-bottom: 20px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-content {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.card-content .el-button {
  margin-right: 10px;
}
</style>